package com.example.dto;

import com.example.util.DateUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@ApiModel(description = "优惠券发放的表单实体")
public class CouponIssueFormDTO {
    @ApiModelProperty("优惠券id")
    @JsonFormat(shape =JsonFormat.Shape.STRING )
    private Long id;


    @ApiModelProperty("使用有效期开始时间")
    @NotNull(message = "使用有效期开始时间不能为空")
    @DateTimeFormat(pattern = DateUtils.DEFAULT_DATE_TIME_FORMAT)
    private LocalDateTime enableStartTime;

    @ApiModelProperty("使用有效期结束时间")
    @NotNull(message = "使用有效期结束时间不能为空")
    @DateTimeFormat(pattern = DateUtils.DEFAULT_DATE_TIME_FORMAT)
    private LocalDateTime enableEndTime;


    @ApiModelProperty("发放数量")
    private Integer publishCount;

    @ApiModelProperty("限领张数")
    private Integer limitReceiveCount;


    @ApiModelProperty("发放开始时间")

    @NotNull(message = "发放结束时间不能为空")

    private LocalDateTime startTime;

    @ApiModelProperty("发放结束时间")

    @NotNull(message = "发放结束时间不能为空")

    private LocalDateTime endTime;


}
